#!/bin/bash

DIR="$1"
OPT="$2"
[ "$DIR" == "" ] && DIR="./"

M11YCODE="/pbfd/manageability"

cppcheck \
  $1 \
  --enable=all \
  -I/usr/include/ \
  -I$M11YCODE/iss/iss-common/hpinc/cpqci/ \
  -I$M11YCODE/iss/iss-common/hpinc/ \
  -I$M11YCODE/include/ \
  -I$M11YCODE/ezbmc/ \
  -I$M11YCODE/ezpci/ \
  -I$M11YCODE/hpmgmtbase/lib/IMLtext/ \
  -I/usr/include/dbus-1.0/dbus/ \
  -I$M11YCODE/smx/smx_trunk/common/ \
  -I$M11YCODE/smx/smx_trunk/common/cmpicpp/ \
  -I$M11YCODE/smx/smx_trunk/common/cmpicpp/CMPI \
  -I$M11YCODE/smx/smx_include/ \
  -I$M11YCODE/shd/synchronizer/include/ \
  -I$M11YCODE/smx/pegasus/src/ \
  -iezbmc/example \
  -iezpci/example \
  -iezpci/unittest \
  -ihpmgmtbase/RAS/devel/ia64_inject \
  -ihpmgmtbase/acpiutils/dev_acpi \
  -ihpmgmtbase/dist_static \
  -ihpmgmtbase/RAS \
  -ihpmgmtbase/bmcutils/hpipmid/testing/ \
  -ismx/smx_trunk/common/tdb \
  $OPT --quiet 2>&1 | awk '{
    if ( $2 != "(information)" && $2 != "(performance)" ){\
      print $0;\
    }\
  }'


